<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->json('channel_info')->comment('渠道信息');
            $table->json('userinfo')->comment('用户信息');
            $table->tinyInteger('status')->comment('状态:-1=>退单,0=>申请中,1=>放款');
            $table->string('reason',200)->nullable()->comment('退单原因,status=-1时,必填');
            $table->json('confirm_loan')->comment('确认放款信息,status=1时必填');
            $table->integer('mid')->comment('签单人id');
            $table->integer('parent_mid')->nullable()->comment('分销人id');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
